import { reactive } from "vue";

/**
 * 新增状态表单验证规则
 */
export const createRules = reactive({
  orderNo: [{ required: true, message: "订单号为必填项", trigger: "blur" }],
  purchasingUnit: [
    { required: true, message: "采购单位为必填项", trigger: "blur" }
  ],
  purchasingDept: [
    { required: true, message: "采购部门为必填项", trigger: "blur" }
  ],
  purchaser: [{ required: true, message: "采购人为必填项", trigger: "blur" }],
  orderTime: [{ required: true, message: "订单时间为必填项", trigger: "blur" }],
  purchaserPhone: [
    { required: true, message: "采购人电话为必填项", trigger: "blur" }
  ]
});

/**
 * 修改状态表单验证规则
 */
export const updateRules = reactive({
  orderNo: [{ required: true, message: "订单号为必填项", trigger: "blur" }],
  purchasingUnit: [
    { required: true, message: "采购单位为必填项", trigger: "blur" }
  ],
  purchasingDept: [
    { required: true, message: "采购部门为必填项", trigger: "blur" }
  ],
  purchaser: [{ required: true, message: "采购人为必填项", trigger: "blur" }],
  receiver: [{ required: true, message: "收货人为必填项", trigger: "blur" }],
  receiverAddress: [
    { required: true, message: "收货地址为必填项", trigger: "blur" }
  ],
  orderTime: [{ required: true, message: "订单时间为必填项", trigger: "blur" }],
  purchaserPhone: [
    { required: true, message: "采购人电话为必填项", trigger: "blur" }
  ],
  receiverPhone: [
    { required: true, message: "收货人电话为必填项", trigger: "blur" }
  ]
});
